package com.ruoyi.system.service.impl;

import java.util.List;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.AppDynamicMsgMapper;
import com.ruoyi.system.domain.AppDynamicMsg;
import com.ruoyi.system.service.IAppDynamicMsgService;

/**
 * 通知消息Service业务层处理
 *
 * @author ruoyi
 * @date 2023-02-28
 */
@Service
public class AppDynamicMsgServiceImpl extends ServiceImpl<AppDynamicMsgMapper, AppDynamicMsg> implements IAppDynamicMsgService {
    @Autowired
    private AppDynamicMsgMapper appDynamicMsgMapper;

    /**
     * 查询通知消息
     *
     * @param id 通知消息主键
     * @return 通知消息
     */
    @Override
    public AppDynamicMsg selectAppDynamicMsgById(Long id) {
        return appDynamicMsgMapper.selectAppDynamicMsgById(id);
    }

    /**
     * 查询通知消息列表
     *
     * @param appDynamicMsg 通知消息
     * @return 通知消息
     */
    @Override
    public List<AppDynamicMsg> selectAppDynamicMsgList(AppDynamicMsg appDynamicMsg) {
        return appDynamicMsgMapper.selectAppDynamicMsgList(appDynamicMsg);
    }

    /**
     * 新增通知消息
     *
     * @param appDynamicMsg 通知消息
     * @return 结果
     */
    @Override
    public int insertAppDynamicMsg(AppDynamicMsg appDynamicMsg) {
        return appDynamicMsgMapper.insertAppDynamicMsg(appDynamicMsg);
    }

    /**
     * 修改通知消息
     *
     * @param appDynamicMsg 通知消息
     * @return 结果
     */
    @Override
    public int updateAppDynamicMsg(AppDynamicMsg appDynamicMsg) {
        return appDynamicMsgMapper.updateAppDynamicMsg(appDynamicMsg);
    }

    /**
     * 批量删除通知消息
     *
     * @param ids 需要删除的通知消息主键
     * @return 结果
     */
    @Override
    public int deleteAppDynamicMsgByIds(Long[] ids) {
        return appDynamicMsgMapper.deleteAppDynamicMsgByIds(ids);
    }

    /**
     * 删除通知消息信息
     *
     * @param id 通知消息主键
     * @return 结果
     */
    @Override
    public int deleteAppDynamicMsgById(Long id) {
        return appDynamicMsgMapper.deleteAppDynamicMsgById(id);
    }

    @Override
    public void updateByUserIdAndMsgStatus(Long userId, int msgStatus) {
        appDynamicMsgMapper.updateByUserIdAndMsgStatus(userId, msgStatus);
    }

    @Override
    public void removeByUserId(Long userId) {
        appDynamicMsgMapper.removeByUserId(userId);
    }
}
